package edu.scau.cxq.gp.quartz.job;

import edu.scau.cxq.gp.quartz.entity.InventoryAlertBean;
import edu.scau.cxq.gp.quartz.entity.QuartzBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @description 定时任务信息Bean
 * @return
 * @author TLC
 */

@Configuration
public class QuartzConfig {

    @Bean
    public QuartzBean quartzBean () {
        QuartzBean quartzBean = new QuartzBean();
        quartzBean.setJobClass("edu.scau.cxq.gp.quartz.job.SortInventoryTask");
        quartzBean.setJobName("sort-inventory");
        quartzBean.setStatus(0); // 未创建
        return quartzBean;
    }

    @Bean
    public InventoryAlertBean inventoryAlertBean () {
        InventoryAlertBean inventoryAlertBean = new InventoryAlertBean();
        inventoryAlertBean.setIsOpen(false); // 默认不开启
        inventoryAlertBean.setThreshold(1000); // 默认阈值为1000
        return inventoryAlertBean;
    }
}
